<?php

declare(strict_types=1);

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

/**
 * 密友
 */
class CloseFriend extends Model
{
    protected $table = 'user_close_friend';
    protected $fillable = ['user_id', 'frd_user_id', 'flag', 'close_value', 'consume_coin', 'consume_ts'];

    public function userProfile()
    {
        return $this->belongsTo(UserProfile::class, 'user_id', 'user_id');
    }

    public function userInfo()
    {
        return $this->belongsTo(User::class, 'user_id', 'id');
    }

    public function frdProfile()
    {
        return $this->belongsTo(UserProfile::class, 'frd_user_id', 'user_id');
    }

    public function frdInfo()
    {
        return $this->belongsTo(User::class, 'frd_user_id', 'id');
    }
}
